package com.sau.pixelcart.domain.entity;

import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import java.time.LocalDateTime;
import java.io.Serializable;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

/**
 * <p>
 * 用户账户信息表
 * </p>
 *
 * @author Inton
 * @since 2025-03-08
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("user")
@ApiModel(value="User对象", description="用户账户信息表")
public class User implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "用户唯一标识")
    @TableId(value = "user_id", type = IdType.ASSIGN_UUID)
    private String userId;

    @ApiModelProperty(value = "用户名（支持邮箱/手机号格式）")
    private String username;

    @ApiModelProperty(value = "BCrypt/Argon2加密后的密码")
    private String password;

    @ApiModelProperty(value = "唯一邮箱（登录/找回密码）")
    private String email;

    @ApiModelProperty(value = "用户角色")
    private String role;

    @ApiModelProperty(value = "注册时间")
    private LocalDateTime registrationTime;

    @ApiModelProperty(value = "最后登录时间")
    private LocalDateTime lastLoginTime;

    @ApiModelProperty(value = "账户状态")
    private String status;

    @ApiModelProperty(value = "是否同意协议（1:同意）")
    private Boolean agreedToTerms;

    @ApiModelProperty(value = "密码重置令牌")
    private String passwordResetToken;

    @ApiModelProperty(value = "令牌过期时间")
    private LocalDateTime tokenExpiryTime;


}
